#ifndef NEXTTODOTABLE_H
#define NEXTTODOTABLE_H

#include <QTableWidget>
#include "taskitem.h"
#include <QLabel>
#include <QHeaderView>
#include "abstracttable.h"

class nextToDoTable: public abstractTable
{
    Q_OBJECT

public:
//    QTableWidget *m_table;

    //"状态" <<"ID"<< "任务名" << "分类" <<"每日番茄数"<< "今日已完成" << "剩余天数" << "操作"
    enum {STATE,ID,NAME,SORT,TOMATO,TODAY,REMAINDAY,DELETE};

    // 图片
    QPixmap m_pix_trash;
    QPixmap m_pix_ready;
    QPixmap m_pix_achieve;
    QPixmap m_pix_not_ready;



public:
    explicit nextToDoTable(QTableWidget *table, abstractTable *parent = nullptr);
    explicit nextToDoTable(abstractTable *parent = nullptr);
    // 添加任务
    void addTask(taskItem &task);
    // 取消显示任务
    void removeTask(int row);

    int getNextTaskRow();

    void updateTask(taskItem &task);

    int getRowWithSort(const taskItem &task);

    // 重写getId
    int getId(int row) override;
    // 重写getName
    QString getName(int row) override;

signals:
    void selectCurrentTask(taskItem &task);
};

#endif // NEXTTODOTABLE_H
